﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/SiteMaster.Master" Inherits="System.Web.Mvc.ViewPage<Microhard.FMCG.WebUI.Areas.Inspection.Models.ItemGridModel>" %>
<%@ Import Namespace="Microhard.Framework.MVCHelper" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
  检查项明细设置
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<div class="section-header">
        <div class="title">
            <img src="<%=Url.Content("~/Content/images/ico-catalog.png")%>" alt="" />
            检查项明细设置
        </div>
        <div class="options">
        </div>
    </div>
    <p>
    </p>
 <table class="adminContent">
        <tr>
            <td>
                <%Html.Telerik().Grid<Micrhard.FMCG.Server.Models.IspTemplateAnswerModel>((List<Micrhard.FMCG.Server.Models.IspTemplateAnswerModel>)this.Model.Data)
                    .Name("operation-grid")
                    .ToolBar(t => t.Template(g =>
                    { %>
                   
                <div class="header-menu">
                    <ul class="t-widget t-reset t-header t-menu">
                        <li class="t-item  t-state-default">                        
                                <%=Html.ActionLink("添加", "IspItemSetCreate", "IspItem", new { ItemID = this.Model.ItemId }, new { @class = "t-button" })%>
                        </li>
                        <li class="t-item  t-state-default">                
                           <%=Html.Authorized_UpdateButton("btnUpdate", "修改", "operation-grid", "IspItemSetUpdate", "IspItem", "Inspection")%>                                     
                        </li>
                        <li class="t-item  t-state-default">
                            <%=Html.Authorized_DeleteButton("btnDelete", "删除", "operation-grid", "IspItemSetDelete", "IspItem", "Inspection")%>
                        </li>
                    </ul>
                </div>
                <%}))
                         .Columns(columns =>
                    {
                        columns.Bound(x => x.CheckListAnswerID)
                       .Template(x => Html.CheckBox("checkedRecords", new { value = x.CheckListAnswerID, @class = "gridCks" }))
                       .ClientTemplate("<input type='checkbox' name='checkedRecords' value='<#= CheckListAnswerID #>' class='gridCks'/>")
                     .HtmlAttributes(new { style = "text-align:center" }).Title("选择");

                        columns.Bound(x => x.Comment).Title("内容");
                        columns.Bound(x => x.Value).Title("分值");                      
                       
                    })
                      .Pageable(settings => settings.Total(Model.Total).PageSize(Html.GetGridPageSize()).Position(GridPagerPosition.Top))
                      //绑定搜索按钮，执行对应的action
                    .DataBinding(dataBinding => dataBinding.Ajax().Select("IspItemSetPageList", "IspItem", new { ItemID = this.Model.ItemId }))
                    .EnableCustomBinding(true)
                    .Render();
                %>
            </td>
        </tr>
    </table>

</asp:Content>
